package com.dyh.quickdemo.outapi;

import org.junit.jupiter.api.Test;

/*
@Author=Joey Wheeler
@Date=2021/4/21 10:30
*/
public class TestOutApiException {

    @Test
    public void test(){
        try {
//            fun(-1);
            fun(1);
        }
        catch (OutApiException oe){//顺序必须要在Re上
            System.out.println("oe");
        }
        catch (RuntimeException re){
            System.out.println("re");
        }
        catch (Exception e) {
            System.out.println("e");
        }
    }

    public void fun(int code){
        if (code<0)
            throw new RuntimeException();
        if (code>0)
            throw new OutApiException("taobao","pushOrder","11");
    }
}
